package com.weige.elefence.api;

import com.weige.elefence.annotation.Autowired;
import com.weige.elefence.annotation.WebApi;
import com.weige.elefence.annotation.WebRoute;
import com.weige.elefence.dto.R;
import com.weige.elefence.service.MqService;

import java.io.IOException;

/**
 * @author ltj
 * @Description 测试类
 * @date 2022/5/23
 */
@WebApi("electronicFence")
public class ElectronicFenceApi {

    @Autowired
    private  MqService mqService;

    @WebRoute("armed")
    public R test(String id, String name) {
        return R.success();
    }

    @WebRoute("mq")
    public R mq() throws IOException {
        boolean send = mqService.send("11111");
        if (send){
            return R.success();
        }
        return R.error("发送失败");

    }
}
